package com.itany.shop.dao;

import com.itany.shop.entity.Order;
import com.itany.shop.exception.DataAccessException;

import java.util.List;

/**
 * Author:shixiaojun@itany.com
 * Date:2022/4/19 10:15
 * Version:1.0-SNAPSHOT
 * Description:
 */
public interface OrderDao {

    /**
     * 保存订单信息
     * @param order
     * @return 返回生成的主键的值
     */
    public Integer insertReturnPrimaryKey(Order order) throws DataAccessException;

    /**
     * 根据用户id查询订单信息
     * @param userId
     * @return
     */
    public List<Order> selectByUserId(Integer userId) throws DataAccessException;

    /**
     * 根据订单主键查询订单详情
     * @param id
     * @return
     */
    public Order selectDetailById(Integer id) throws DataAccessException;
}
